package com.linkvin.ec.hcs.service.util.enums;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

public enum PowerTypeEnum {

    //燃油形式 10 汽油 20 柴油 30 插电式混合动力 40 油电混合 50 纯电动 60 增程式
    GASOLINE("10", "汽油"),
    DIESEL("20", "柴油"),
    PHEV("30", "插电式混合动力"),
    GASELECTRIC("40", "油电混合"),
    ELECTRIC("50", "纯电动"),
    EXTENDEDRANGE("60", "增程式");

    private final String value;
    private final String text;

    private static final Map<String, String> lookup = new HashMap<>();

    static {
        for (VehicleAirSuctionEnum s : EnumSet.allOf(VehicleAirSuctionEnum.class)) {
            lookup.put(s.getValue(),s.getText());
        }
    }

    PowerTypeEnum(String value, String text) {
        this.value = value;
        this.text = text;
    }

    /**
     * Gets value.
     *
     * @return the value
     */
    public String getValue() {
        return value;
    }

    /**
     * Gets text.
     *
     * @return the text
     */
    public String getText() {
        return text;
    }

    /**
     *
     * @param value
     * @return
     */
    public static PowerTypeEnum getByValue(String value) {
        for (PowerTypeEnum temp : PowerTypeEnum.values()) {
            if (temp.getValue().equals(value)) {
                return temp;
            }
        }
        return null;
    }

    /***
     * 得到所有的值
     * @return
     */
    public static Map<String, String> lookup() {
        return lookup;
    }


}
